Private hIcons(4) As Long 'Hold Icon Images so we don't have to keep hitting the harddrive
Private Declare Function InitCommonControlsEx Lib "Comctl32.dll" (iccex As tagInitCommonControlsEx) As Boolean
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DrawIconEx& Lib "user32" (ByVal hdc As Long, ByVal xleft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long)
Private Declare Function ExtractIconEx Lib "shell32.dll" Alias "ExtractIconExA" (ByVal lpszFile As String, _
ByVal nIconIndex As Long, phiconLarge As Long, phiconSmall As Long, ByVal nIcons As Long) As Long
Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function FillRect Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT, ByVal bErase As Long) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wcmd As Long) As Long
Private Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function apiGetWindowDC& Lib "user32" Alias "GetWindowDC" (ByVal hwnd As Long)
Private Declare Function apiGetDC& Lib "user32" Alias "GetDC" (ByVal hwnd As Long)
Private Declare Function SendStringMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Declare Function CreateWindowEX Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
'Form is sized too small and the pane is not visible then exit
If StatBarRect.Right - StatBarRect.Left <= 0 Then Exit Sub
PaintBrush = CreateSolidBrush(GetSysColor(15)) 'System Button color
'fill Pane with Brush of System Button Color
BrushRect.Top = StatBarRect.Top + 2
BrushRect.Left = StatBarRect.Left + 2
BrushRect.Right = StatBarRect.Right - 2
BrushRect.Bottom = StatBarRect.Bottom - 2
dl = FillRect(StatBarDC, BrushRect, PaintBrush)
If sbAlignment = CENTER Then TextAlign = DT_CENTER
If sbAlignment = Left Then TextAlign = DT_LEFT
If sbAlignment = Right Then TextAlign = DT_RIGHT
StatBarRect.Left = StatBarRect.Left + textoffset
StatBarRect.Right = StatBarRect.Right - 2
dl = DrawTextEx(StatBarDC, strText, Len(strText), StatBarRect, TextAlign Or DT_VCENTER& Or DT_SINGLELINE Or DT_END_ELLIPSIS Or DT_PATH_ELLIPSIS Or DT_MODIFYSTRING, dt)